/*
 *@Description: 工程全局方法 挂载在global
 *@Author:  lupan
 *@Date: 2019-07-14 14:04:35
*/
const query = require('./query')
const log = require('consola')
const moment = require('moment')
const msg = require('./message')
const check = require('./check')
const dbQuery = require('./queryMethods')
/*
 *@Description: 日志打印方法
 *@params: 
 *@Author:  lupan
 *@Date: 2019-07-14 16:02:12
*/
const logs = {
  success: (msg) => {
    log.success(`[${moment().format('YYYY-MM-DD HH:mm:ss')}]：${msg}`)
  },
  error: (msg) => {
    log.error(`[${moment().format('YYYY-MM-DD HH:mm:ss')}]：${msg}`)
  },
  warn: (msg) => {
    log.warn(`[${moment().format('YYYY-MM-DD HH:mm:ss')}]：${msg}`)
  }
}

global.$query = query
global.$log = logs
global.$moment = moment
global.$msgSuccess = msg.msgSuccess
global.$msgError = msg.msgError
global.$check = check
global.$dbQuery = dbQuery
$log.success('工程工具库挂载成功')